package com.traffic.service.impl;

import java.util.List;
import com.ruoyi.common.core.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.traffic.mapper.PerLeaveManagementMapper;
import com.traffic.domain.PerLeaveManagement;
import com.traffic.service.IPerLeaveManagementService;

/**
 * 离岗管理Service业务层处理
 * 
 * @author 郭世纪
 * @date 2024-12-08
 */
@Service
public class PerLeaveManagementServiceImpl implements IPerLeaveManagementService 
{
    @Autowired
    private PerLeaveManagementMapper perLeaveManagementMapper;

    /**
     * 查询离岗管理
     * 
     * @param leaveId 离岗管理主键
     * @return 离岗管理
     */
    @Override
    public PerLeaveManagement selectPerLeaveManagementByLeaveId(Long leaveId)
    {
        return perLeaveManagementMapper.selectPerLeaveManagementByLeaveId(leaveId);
    }

    /**
     * 查询离岗管理列表
     * 
     * @param perLeaveManagement 离岗管理
     * @return 离岗管理
     */
    @Override
    public List<PerLeaveManagement> selectPerLeaveManagementList(PerLeaveManagement perLeaveManagement)
    {
        return perLeaveManagementMapper.selectPerLeaveManagementList(perLeaveManagement);
    }

    /**
     * 新增离岗管理
     * 
     * @param perLeaveManagement 离岗管理
     * @return 结果
     */
    @Override
    public int insertPerLeaveManagement(PerLeaveManagement perLeaveManagement)
    {
        return perLeaveManagementMapper.insertPerLeaveManagement(perLeaveManagement);
    }

    /**
     * 修改离岗管理
     * 
     * @param perLeaveManagement 离岗管理
     * @return 结果
     */
    @Override
    public int updatePerLeaveManagement(PerLeaveManagement perLeaveManagement)
    {
        perLeaveManagement.setUpdateTime(DateUtils.getNowDate());
        return perLeaveManagementMapper.updatePerLeaveManagement(perLeaveManagement);
    }

    /**
     * 批量删除离岗管理
     * 
     * @param leaveIds 需要删除的离岗管理主键
     * @return 结果
     */
    @Override
    public int deletePerLeaveManagementByLeaveIds(Long[] leaveIds)
    {
        return perLeaveManagementMapper.deletePerLeaveManagementByLeaveIds(leaveIds);
    }

    /**
     * 删除离岗管理信息
     * 
     * @param leaveId 离岗管理主键
     * @return 结果
     */
    @Override
    public int deletePerLeaveManagementByLeaveId(Long leaveId)
    {
        return perLeaveManagementMapper.deletePerLeaveManagementByLeaveId(leaveId);
    }
}
